package com.example.demo.jucConcurrent.ThreadPoolExecutor详解;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SimpleThreadPool {

    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(5);
        for (int i = 0; i < 10; i++) {

            Runnable worker = new WorkThread("" + 1);
            executorService.execute(worker);
        }
        executorService.shutdown();
        while (!executorService.isTerminated()){
        }
        System.out.println("finished all Thread");
    }
}
